package com.wowudi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wowudi.dto.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wowudi.entity.Department;
import com.wowudi.mapper.DepartmentMapper;
import com.wowudi.service.DepartmentService;

import java.util.List;

@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService{

    @Autowired
    private DepartmentMapper deptMapper;

    /**
    * Description: 根据id查询部门信息<br/>
    * date: 2022-3-18<br/>
    * @author 贺同志<br/>
    */
    @Override
    public Department findDepartmentById(Long deptId) {
        Department department = deptMapper.selectById(deptId);
        return department;
    }

    /**
    * Description: 查询所有部门信息<br/>
    * date: 2022-3-18<br/>
    * @author 贺同志<br/>
    */
    @Override
    public List<Department> findDepartmentAll() {
        List<Department> departmentList = deptMapper.selectList(null);
        return departmentList;
    }
}
